package org.ztr.yanai.blog.annotation;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import org.ztr.yanai.blog.validator.IdCardValidator;

import java.lang.annotation.*;

/**
 * @Author: ZhaoTR
 * @Date: Created in 2025/11/22 14:30
 * @Description: 身份证号校验注解
 * @Version: 1.0
 */
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = IdCardValidator.class)
public @interface IdCard {
    
    String message() default "身份证号格式不正确";
    
    Class<?>[] groups() default {};
    
    Class<? extends Payload>[] payload() default {};
}
